<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>评价记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="/static/favicon.ico">
    <link href="/static/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/static/css/animate.css" rel="stylesheet">
    <link href="/static/css/style.css?v=4.1.0" rel="stylesheet">

    <link rel="stylesheet" href="/static/plugins/bootstrap-table/bootstrap-table.min.css">
    <link rel="stylesheet" href="/static/plugins/bootstrap-validator/css/bootstrapValidator.min.css">
    <!-- Latest compiled and minified CSS -->
    <style>
        /* ibox 背景 */
        .ibox-blue > .ibox-title {
            border-color: rgb(57, 174, 245);
        }
        .form-control:focus,
        .single-line:focus {
            border-color: #0e9aef !important;
        }
        .checkbox-inline {
            line-height: 5px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins ibox-blue">
        <div class="ibox-title">
            <h5>评价记录</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
                <a class="close-link">
                    <i class="fa fa-times"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">

            <div class="row row-lg">
                <div class="example" style="margin-top: -10px;">
                    <div class="btn-group hidden-xs" id="toolbar" role="group">

                    </div>

                    <table id="TableEvents"></table>

                </div>
            </div>

        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="/static/js/content.js?v=1.0.0"></script>
<script src="/static/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/static/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/static/plugins/bootstrap-validator/js/bootstrapValidator.min.js"></script>
<script src="/static/plugins/bootstrap-validator/js/language/zh_CN.js"></script>
<script>
    $(function () {
        $("#TableEvents").bootstrapTable({
            url: '/admin/erecord/getList',
            method: 'post',
            contentType: "application/x-www-form-urlencoded",
            queryParamsType: '',//查询参数组织方式
            queryParams: queryParams,//请求服务器时所传的参数
            sidePagination: 'server',//指定服务器端分页
            search: true,
            strictSearch:true,
            searchOnEnterKey: true,
            pagination: true,
            showRefresh: true,
            showToggle: true,
            showColumns: true,
            striped: true,
            sortable: false,
            sortOrder: "asc",
            clickToSelect: true,
            pageNumber: 1,
            pageSize: 10,
            pageList: [1, 5, 10, 25, 50, 100, 'ALL'],
            iconSize: 'outline',
            toolbar: '#toolbar',
            icons: {
                refresh: 'glyphicon-repeat',
                toggle: 'glyphicon-list-alt',
                columns: 'glyphicon-list'
            },
            responseHandler: function (res) {
                //在ajax获取到数据，渲染表格之前，修改数据源
                /*console.log(res)*/
                console.log(res)
                return {"total": res[0].total, "rows": res[1]};
            },
            columns: [
                {
                    field: 'id',
                    title: 'ID',
                    align: 'center'
                },
                {
                    field: 'euser_id',
                    title: '评价人',
                    align: 'center'
                },
                {
                    field: 'teacher_id',
                    title: '被评人',
                    align: 'center'
                },{
                    field: 'course_id',
                    title: '担任班级',
                    align: 'center'
                },{
                    field: 'clazz_id',
                    title: '课程',
                    align: 'center'
                }
                ,{
                    field: 'etask_id',
                    title: '所属任务',
                    align: 'center'
                }
                ,{
                    field: 'etype_id',
                    title: '评价类型',
                    align: 'center'
                }
                ,{
                    field: 'score',
                    title: '得分',
                    align: 'center'
                }
                ,{
                    field: 'addtime',
                    title: '评价时间',
                    align: 'center'
                }/*,
                                   {
                                        field: 'id',
                                        title: '操作',
                                        align: 'center',
                                        formatter:function(value,row,index){
                                            //通过formatter可以自定义列显示的内容
                                            //value：当前field的值，即id
                                            //row：当前行的数据
                                            var a = '<a href="" >测试</a>';
                                            return a + value;
                                        }
                                    }*/
            ]
        });

        //请求服务数据时所传参数
        function queryParams(params) {
            return {
                pageNumber: params.pageNumber,
                pageSize: params.pageSize,
                searchText: params.searchText
            }
        }
    });
</script>
</body>
</html>